package cn.wolfcode.enums;

import lombok.Getter;

@Getter
public enum ConsumptionReportEnum {
    BUSINESS("门店","b.name"),
    YEAR("年","DATE_FORMAT(c.pay_time,'%Y')"),
    MONTH("月","DATE_FORMAT(c.pay_time,'%Y-%m')"),
    DAY("日","DATE_FORMAT(c.pay_time,'%Y-%m-%d')");

    private String value;
    private String name;

    ConsumptionReportEnum(String name, String value) {
        this.name=name;
        this.value=value;
    }

    public static String findName(Integer value){
        ConsumptionReportEnum[] enums = values();
        for (ConsumptionReportEnum anEnum : enums) {
            if(anEnum.getValue().equals(value)){
                return anEnum.getName();
            }
        }
        return null;
    }
}
